/*
 * @lc app=leetcode.cn id=520 lang=javascript
 *
 * [520] 检测大写字母
 */

// @lc code=start
/**
 * @param {string} word
 * @return {boolean}
 */
var detectCapitalUse = function(word) {
    function onlyFirst(e) {
        return e.slice(1) === e.slice(1).toLocaleLowerCase() && e[0] === e[0].toLocaleUpperCase()
    }
    return word === word.toLocaleLowerCase() || word === word.toLocaleUpperCase() || onlyFirst(word)
};
// @lc code=end

